﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WorldConqueror.Libraries.Maths.Costants;
using WorldConqueror.Libraries.Maths.MathShapes;

namespace WorldConqueror.Libraries.Maths.Functions.Area
{

    public class SphericalCircleArea :  MathShapeArea<IMathSphericalCircle>
    {
        public SphericalCircleArea(IMathSphericalCircle mathShape)
            : base(mathShape)
        {
        }

        public override double CalculateBase()
        {
            var radiusMinusHeight = Math.Sqrt(Math.Pow(EarthConstants.EarthRadius, 2) - Math.Pow(MathShape.Radio, 2));
            var height = EarthConstants.EarthRadius - radiusMinusHeight;

            return 2 * Math.PI * EarthConstants.EarthRadius * height;
        }
    }
}
